<?php slot('header')?>
<script type="text/javascript">
$(function(){
	MAIN.setMenu('share');
	
});
</script>
<?php end_slot()?>
<main>
	<aside class="left">
		<nav class="content">
			<a href="<?php echo url_for2('news')?>"><h1>Chia sẻ</h1></a>
			<ul>
				<?php foreach($data['cates'] as $cate):?>
				<li><a class="<?php echo intval($data['cate_id']) == intval($cate['id'])? '-active': ''?>" href="<?php echo url_for2('news', array('cate_id' => $cate['id']))?>" title="<?php echo $cate['name']?>" alt="<?php echo $cate['name']?>"><h1><?php echo $cate['name']?></h1></a></li>
				<?php endforeach?>
			</ul>
			<div class="clr"></div>
		</nav>
		<div>
			<?php include_component('componentUlti', 'news', array('act' => $data['act'], 'page' => $data['page'], 'cate_id' => $data['cate_id'], 'id' => $data['id']))?>
		</div>
	</aside>
	<aside class="right">
		<div class="bar-title">
			<h1 class="right">Bài viết quan trọng</h1>
		</div>
		<?php 
		$clear = '';
		foreach($data['news'] as $news):
		$url = url_for2('news_detail', array('id' => $news['id'], 'cate_id' => $news['cate_id'], 'title' => UserStringHelper::titleToAddress($news['title'])));
		echo $clear;
		?>
		<article class="news-item">
			<a title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>"><h1><?php echo $news['title']?></h1></a>
			<?php if (!empty($news['photo_url'])):?><div class="thumb"><a title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>"><img src="<?php echo $news['photo_url']?>" title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>"/></a></div><?php endif;?>
			<div class="des">
				<?php echo html_entity_decode($news['description'])?>
			</div>
			<a class="button right" title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>">Xem thêm</a>
		</article>
		<div class="clr"></div>
		
		<?php
		
		$clear = '<div class="line"></div>';
		endforeach?>
	</aside>
	<div class="clr"></div>
</main>